#if you want to use recursive func,please make recu=y
ifeq (y, $(recu))
	CFLAGS += -DRECU
endif

ifeq (y, $(debug))
	CFLAGS += -g
endif

CC = gcc
CPLUS = g++
CFLAGS += -Wall
TARGET = tree

all:$(TARGET)

.c.o:
	$(CC) $(CFLAGS) -o $@ -c $<

.cpp.o:
	$(CPLUS) $(CFLAGS) -o $@ -c $<

$(TARGET): non_binarytree.o binarytree.o main.o
	$(CPLUS) $(CFLAGS) -o $@ $^

test:
	@./tree > result.txt && python result.py | tree -b2

.PHONY: all clean
clean:
	$(RM) $(TARGET) *.o
